import request from '@/config/axios'

export interface materialPickVO {
  orderCode: string,
  type: string,
  code: string,
  specification: string,
  racketModel: string
  sheetNum: string,
  weight: string,
  cutSize: string,
  knivesNum: string,
  amount: string,
  materialsCut: string,
  addLayers: string,
  materialStatus: string
}

// 查询
export const getmaterialPick = (params: PageParam) => {
  return request.get({ url: '/project/order/createPreparationByOrderCode', params })
}

// 修改
export const materialPickEdit = (data: materialPickVO) => {
  return request.post({ url: '/project/kis-materiel-ex-warehouse/materiaPick', data })
}

// 审核
export const materialPickCheck = (data) => {
  return request.post({ url: '/project/kis-materiel-ex-warehouse/materiaExamine', data })
}

// 驳回
export const materialPickReject = (data) => {
  return request.post({ url: '/project/kis-materiel-ex-warehouse/materiaReject', data })
}

// 导出
export const exportMaterialPick = (data) => {
  return request.download({ url: '/project/kis-materiel-ex-warehouse/exportExcel', data })
}

// 提交出库
export const subOutbound = (data) => {
  return request.post({ url: '/project/order/createInternalCodeByOrderCode', data })
}

// 查询多个箱码数量
export const materialPickNum = (data) => {
  return request.get({ url: '/project/kis-materiel-ex-warehouse/get?id='+ data })
}

// 清除箱码
export const materialPickDelete = (data) => {
  return request.get({ url: '/project/kis-materiel-ex-warehouse/clearMultiCartonCode?id='+ data })
}

// 根据生产订单检查物料单是否全部审核通过
export const materialPickStatus = (data) => {
  return request.post({ url: '/project/order/checkExCodeStatus', data })
}

export const queryOrderFlexList = (orderCode) => {
  return request.get({ url: '/project/order-detail/queryOrderFlexList?orderCode=' + orderCode })
}
